<?php
session_start();
function utf8Substr($str, $from, $len)
{
return preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'.
'((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s',
'$1',$str);
} 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员订餐</title>
<link href="style/css.css" rel="stylesheet" type="text/css">

<script src="js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="js/jquery.blockUI.js" type="text/javascript"></script>
<script src="js/My97DatePicker/WdatePicker.js"
      type="text/javascript"></script> 
<script src="js/shoppingCart.js" type="text/javascript"></script>
<script type="text/javascript"> 
function  songok(){
  $("#zongjialo").html($("#lastprice").html());
  //给box_btn绑定一个鼠标点击的事件
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#loginbox7'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
  width: '490px',
  top:  ($(window).height() - 290) /2 + 'px', 
    left: ($(window).width() - 490) /2 + 'px', 
  cursor: 'auto'
       },
  overlayCSS: {
  opacity: '0.7' 
            }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层



}
function anotherHuifu(){

alert("请登录后进行留言");

}
function doMyComment(thishow){
if(thishow==0){
  $("div[id*='ccshow']").css("display","inline");
  $("#ihuifu").attr("onclick","doMyComment(1)");
}else if(thishow==1){
$("div[id*='ccshow']").css("display","none");
  $("#ihuifu").attr("onclick","doMyComment(0)");

}


}

function showxiadan(){
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#loginbox5'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
  padding: '22px',
  width: '694px',
  top:  ($(window).height() - 580) /2 + 'px', 
    left: ($(window).width() - 694) /2 + 'px', 
  cursor: 'auto'
       },
  overlayCSS: {
  opacity: '0.7' 
            }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层

}
function newAddress(){

document.getElementById("newAddressii").checked=true;


}



$(function(){ 
//Default Action   
$(".tab_content").hide(); //Hide all content 
$("ul.tabs li:first").addClass("active").show(); //Activate first tab 
$(".tab_content:first").show(); //Show first tab content 
//On Click Event 
$("ul.tabs li").click(function() { 
$("ul.tabs li").removeClass("active"); //Remove any "active" class 
$(this).addClass("active"); //Add "active" class to selected tab 
$(".tab_content").hide(); //Hide all tab content 
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content 
$(activeTab).fadeIn(); //Fade in the active content 
return false; 
}); 
}); 
</script> 
<script type="text/javascript"> 
$(function(){
$('#login').click(function(){   //给box_btn绑定一个鼠标点击的事件
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#loginbox'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
  width: '490px',
  top:  ($(window).height() - 290) /2 + 'px', 
    left: ($(window).width() - 490) /2 + 'px', 
  cursor: 'auto'
       },
  overlayCSS: {
  opacity: '0.7' 
            }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层

});




$('#order').click(function(){ 
	if(!(parseInt($("#lastprice").html())>0)){
		alert("请选择您要预定的套餐");
		return;
	}
  //给box_btn绑定一个鼠标点击的事件
$.blockUI({    //当点击事件发生时调用弹出层
  message: $('#orderbox'),    //要弹出的元素box
  css: {    //弹出元素的CSS属性
    border:'5px solid #334343',
    textAlign: 'left',
  padding: '22px',
  width: '694px',
  top:  ($(window).height() - 580) /2 + 'px', 
    left: ($(window).width() - 694) /2 + 'px', 
  cursor: 'auto'
       },
  overlayCSS: {
  opacity: '0.7' 
            }
         });
$('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
$('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层

});




$('#insertOrder').click(function(){

var ordermessage=$("#ordermessage").val();
var radiovalue=$("input[name='addr'][type='radio']:checked").val();
var  songtype=0;

if(radiovalue=="insertNewAddress"){
songtype=0;
}else{
  songtype=1
}


var allid="";
var allnum="";
var allmoney=$("#lastprice").html();
var orderphone=$("#orderphone").html();
var supplierid=$("#orderOwnsid").val();

$("tr[id*='ownOrderNum']").each(function(i){
 
 if(i==0){
allid+=$(this).attr("sigin");
 }else{
	allid+=","+$(this).attr("sigin");
 }
});

$("span[id*='gouwunum']").each(function(i){
 
 if(i==0){
allnum+=$(this).html();
 }else{
	allnum+=","+$(this).html();
 }
});

var herfvalue="";
if(songtype==1){

  hrefvalue="allid="+allid+"&allnum="+allnum+"&allmoney="+allmoney+"&orderphone="+orderphone+"&supplierid="+supplierid+"&consigneeid="+radiovalue+"&songtype=1"+"&ordermessage="+ordermessage+"&songcantime="+$("#songcantime").val();
}else if(songtype==0){

	
if(!($("#newAddress").val().length>0)){
	alert("请填写地址");
	return;
}

var me= /^1[3|4|5|8][0-9]\d{4,8}$/;
  if (!me.test($("#newphonenum").val()))
  {
    alert("请填写正确的手机号码!");
    $("#newphonenum").focus();
    return (false);
  }

  
  
  hrefvalue="allid="+allid+"&allnum="+allnum+"&allmoney="+allmoney+"&orderphone="+orderphone+"&supplierid="+supplierid+"&newAddress="+$("#newAddress").val()+"&newphonenum="+$("#newphonenum").val()+"&songtype=0"+"&ordermessage="+ordermessage+"&songcantime="+$("#songcantime").val();

}

$.ajax({ 
    type:'get', //传送的方式,get/post 
    url:'saveShoppingCart.php', //发送数据的地址 
    cache:'false', 
    data:hrefvalue, 
    dataType: 'text',
    success:function(data) 
    { if(data="success"){
      $(".blockUI").css("display","none");
      songok()
   

    }else if(data=="error"){
      alert("下单失败");
    }
    }
  }) 



});



});
</script> 


<script type="text/javascript"> 
 
$(document).ready(function(){
$("#content").val($("#content").val().replace(/[ ]/g,""));



});
addComment();//刚到这个页面需要显示所有留言

function addComment() //点击提交留言ajax显示
{ 
 var hmtlv="";
  
	var content=$("#content").val();
  var sid="<?php echo $_GET['supplierid'] ?>";

  if( typeof(content)=="undefined"){
    content="daishuaige";
  }
	$.ajax({ 
		type:'post', //传送的方式,get/post 
		url:'commentAjax.php', //发送数据的地址 
		cache:'false', 
		data:'name='+content+"&sid="+sid, 
		dataType: 'xml',
		success:function(data) 
		{ 
      $("#showMessage").html(" ");
     
     
        
			//alert("提交留言成功!"); 
//			alert(data);
			$(data).find("pcomment").each(function(){
          var ku="";
				var content   = $(this).children("content").text();
				var createtime = $(this).children("createtime").text();
				var username = $(this).children("username").text(); 
        var adminreply=$(this).children("adminreply").text(); 
        
        var guan="";
        if(adminreply!=""&&adminreply!=null){
          guan='<div class="hf clearfix">'+'管理员   回复:<br>'+adminreply+'</div>';

        }
        ku+='<li class="clearfix">'+
              '<div class="left clearfix"><span id="c_content" ></span></div> <div class="clearfix"><span class="right" id="c_createtime" ></span><span class="right" id="c_username"></span></div>'+
             '<div class="hf clearfix">'+username+'    于'+createtime+'发表:<br>'+content+'</div>'+

             guan+

           '</li>';
          
        
        $("#showMessage").append(ku);


				 
			});
		}
	}) 
} 


//单击我要留言显示输入框
function forgetPass(){
   //给box_btn绑定一个鼠标点击的事件
  $.blockUI({    //当点击事件发生时调用弹出层
    message: $('#loginbox3'),    //要弹出的元素box
    css: {    //弹出元素的CSS属性
      border:'5px solid #334343',
      textAlign: 'left',
    width: '490px',
    top:  ($(window).height() - 290) /2 + 'px', 
      left: ($(window).width() - 490) /2 + 'px', 
    cursor: 'auto'
         },
    overlayCSS: {
    opacity: '0.7' 
              }
   });
  $('.blockOverlay').attr('title','单击关闭').click($.unblockUI);   //遮罩层属性的设置以及当鼠标单击遮罩层可以关闭弹出层
  $('.close').click($.unblockUI);  //也可以自定义一个关闭按钮来关闭弹出层
 

  




}
var sendPhone="";
function phoneCheck(){

var yanzhengma=$("#yanzhengma").val();
//
if(yanzhengma==""){
    alert("请输入验证码!");
  }else{

    $.ajax({ 
    type:'post', //传送的方式,get/post 
    url:'phonecheckAjax.php', //发送数据的地址 
    cache:'true',  
    data:'phonecheck='+yanzhengma,
    datatype:"text",
    success:function(data) 
    { 
      
     if(data=="yes"){
      
       $.ajax({ 
    type:'post', //传送的方式,get/post 
    url:'sendupdatePass.php', //发送数据的地址 
    cache:'true',  
    data:'phonecheck=2',
    datatype:"text",
    success:function(data) 
    { 
      var hi=data.split(",");
      if(hi[0]=="yes"){

    $.ajax({ 
               type:'post', //传送的方式,get/post 
               url:'post_mt1.php', //发送数据的地址 
               cache:'false', 
               data:'name='+sendPhone+"&sendValue="+"您的重置密码为:"+hi[1],  
              success:function(data) 
                { 
      
                }
            });


        alert("成功重置，密码会以短信形式发送给您");


      }else if(hi[1]=="no"){
        alert("重置密码失败");
      }

    } 
  }); 





     
     }else if(data=="no"){
     alert("验证码错误");

     }else{
      alert("验证码错误");
     }
    } 
  }); 

  }


//



}
function sendSMS() //点击提交留言ajax显示
{ 
  
  var zhanghao=$("#userzhanghao").val();

  $.ajax({ 
    type:'post', //传送的方式,get/post 
    url:'getUsername.php', //发送数据的地址 
    cache:'false', 
    data:'zhanghao='+zhanghao, 
    datatype:"text",
    success:function(data) 
    { 
      var hi=data.split(",");
      if(hi[0]=="success"){
        sendPhone=hi[1];
        $.ajax({ 
               type:'post', //传送的方式,get/post 
               url:'post_mt.php', //发送数据的地址 
               cache:'false', 
               data:'name='+hi[1], 
              success:function(data) 
                { 
              
                }
            })

      }else{

        alert("该账号不存在");
      }

    }
  });


  
/*   */

  time(document.getElementById("reSend"));
} 

</script>



<?php


//包含数据库连接文件
//session_start();
include('system/db/conn.php');
$supplierid=$_GET['supplierid'];  
$local_array = mysql_query("select dsl.*,ds.* from do_supplier_location dsl,do_supplier ds where dsl.supplier_id=$supplierid and dsl.supplier_id=ds.id");

$row = mysql_fetch_row($local_array);

$online_info = $row[81] ;//友情提示
$stopbusiness = $row[84];//停业
$open_time = $row[9];//营业时间
$is_drink = $row[85];//送饮料
$is_timelypay = $row[86];//显示赔付
$is_discount = $row[87];//优惠
mysql_free_result($local_array);
$hello = explode('-',$row[9]); 
$cod = date('YmdHis').rand(0,9999);

//$local_array2 = mysql_query("select * from do_article where id=44");
//$row6 = mysql_fetch_row($local_array2);

//mysql_free_result($local_array2);
?> 
</head>
 
<body>
<input type="hidden"  id="orderOwnsid" value="<?php echo $supplierid ?>" />
<div id="loginbox" style="display:none">
<form name="LoginForm" method="post" id="alllogin" action="login.php" onSubmit="return InputCheck(this)">
  <div class="login_title">会员登录</div>
  <div class="login_input">
    <div class="input"><span>账号：</span><span><input name="username" type="text" /></span></div>
    <div class="input"><span>密码：</span><span><input name="password" type="password" /></span></div>
    <input name="headeraction" type="hidden" value="sub1" />
    <input name="sub1supplierid" type="hidden" value="<?php echo $supplierid ?>" />
    <div class="login_input_1 clearfix"><input name="" type="checkbox" value="" id="store1" /><label for="store1">自动登录</label><a onclick="forgetPass()" href="javascript:void(0)">找回密码</a><span style="color:red;display:none" id="passerrorShow" >&nbsp;&nbsp;账号或密码错误</span></div>
    <div class="reg clearfix"><span><input class="login_btn" name="submit" type="image" src="images/login.jpg" /></span><span>还没有账号？</span><a href="reg11.php">立即注册</a></div>
  </div>
</form>
</div>

 <div id="loginbox7" style="display:none">
  <div class="ddcg_qd"><img src="images/duigou.jpg" width="49" height="49" /></div>
  <div class="ddcg_qdr">
    <div class="ddcg_qdcg">订单已成功提交，请耐心等待你的外卖</div>
    <div class="ddcg_qdje">订单总额为<span id="zongjialo"></span>元！</div>
    <div class="ddcg_qdqd close"  ><input type="image"  src="images/loginqd.jpg"></div>
  </div>
  <div class="clearfix"> </div>
</div>

<div id="loginbox1" style="display:none">
<form name="LoginForm" method="post" id="alllogin" action="login-shop.php" onSubmit="return InputCheck(this)">
  <div class="login_title">店铺登录</div>
  <div class="login_input">
    <div class="input"><span>账号：</span><span><input name="username" type="text" /></span></div>
    <div class="input"><span>密码：</span><span><input name="password" type="password" /></span></div>
    <div class="reg clearfix"><span><input class="login_btn" name="submit" type="image" src="images/login.jpg" /></span><span style="color:red;display:none" id="passerrorShow1" >&nbsp;&nbsp;账号或密码错误</span></div>
  </div>
</form>
</div>
<div id="loginbox3" style="display:none">
  <div class="login_title">忘记密码</div>
  <div class="login_input">
    <div class="inputb"><span>账号：</span><span><input  name="username" id="userzhanghao" type="text" /></span></div>
    <div class="inputc"><span></span><span><input style="width:98px;height:22px;color: #336666;
    font-size: 12px;
    
    line-height: 32px;" id="reSend" value="发送验证码" onclick="sendSMS()" name="password" type="text" /></span></div>
     <div class="inputa"><span>验证码：</span><span><input style="width:98px;" id="yanzhengma" name="password" type="password" /></span></div>
    <div class="reg clearfix"><span><input class="" onclick="phoneCheck()" type="image" src="images/login.jpg" /></span></div>
  </div>

</div>

<div id="loginbox5" style="display:none">
  <div class="login_title">系统消息</div>
  <div class="login_input">
    <div class="inputb" style="padding-left:85px;">该店铺已停业</div>
    
  </div>

</div>



<div class="top">
  <div class="top_content clearfix"><span class="left"><a href="index.php"><img src="images/wmwlogo.png"></a></span><span class="right">
 
  <?php
    if(isset($_SESSION['username'])){
      if($_SESSION['logintype']=="userlog"){
     echo '<a href="member.php">'.$_SESSION['username'],'欢迎你！</a>';
}elseif ($_SESSION['logintype']=="supplierlog") {
   echo '<a href="shop-xx.php">'.$_SESSION['username'],'欢迎你！</a>';
}
      echo '<a href="login.php?action=logout">登出</a>';
    }else{
      echo ' <a href="#" id="login">';
      echo '登录';
      echo '</a> / <a href="reg11.php">注册</a>';
    }
  ?>
  <?php  
      if(!isset($_SESSION['username'])  ){
   ?>
  
  <?php 
    }

   ?>
</div>

<div id="orderbox" style="display:none">
  <div class="box">
    <div class="box_title"><div class="box_title_title left">美食订单</div><div class="box_title_right right"><span>价格</span><span>数量</span><span>总计</span></div></div>
    <div class="orderbox">
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="orderbox_list" id="bigorder">
        
      </table>
    </div>
    <div class="order_total clearfix">
      <div class="left"><input type="text" id="ordermessage" placeholder="订单备注..." class="order_mess" ></div>
      <div class="amount right"><span>共<span id="jifenmeishi"></span>份美食</span><span class="amount_amount">应付金额：<span style="font-size:20px;">￥<span id="yingfuprice"></span></span></span></div>
    </div>
    <div class="order_addr clearfix">
      <div class="order_addr_title left">送达地址： </div>
      <ul class="order_addr_list left">
      <?php
if(isset($_SESSION['userid'])){
      ?>
       <li class="order_addr_list_1"><input id="newAddressii" value="insertNewAddress" type="radio" name="addr"  class="addr"><input class="addr_input" placeholder="地址" id="newAddress" onfocus="newAddress()" type="text"><input class="addr_input" onfocus="newAddress()"  id="newphonenum" placeholder="手机号码"  type="text"></li>
      <?php
}else{
      ?>
       
        <li class="order_addr_list_1"><input id="newAddressii" value="insertNewAddress" checked="checked" type="radio" name="addr"  class="addr"><input class="addr_input" id="newAddress" placeholder="地址" onfocus="newAddress()" type="text"><input class="addr_input" onfocus="newAddress()"  id="newphonenum" placeholder="手机号码"  type="text"></li>

  <?php
  }    
?>
        <?php

        if(isset($_SESSION['userid'])){
 $another_query5 = mysql_query("select * from do_user_consignee t  where t.user_id=".$_SESSION['userid']." order by id desc limit 3");

          while($rowa1 = mysql_fetch_array($another_query5)){
            if($rowa1['isdefult']==1){
        ?>  


        <li class="order_addr_list_2"><label><input type="radio" checked="checked" name="addr" id="consigneeRadio" value="<?php echo $rowa1['id'] ?>"> <?php echo $rowa1['address']."    " ?><?php echo $rowa1['mobile'] ?></label></li>
       
      <?php
      }else{
        ?>

  <li class="order_addr_list_2"><label><input type="radio"  name="addr" id="consigneeRadio" value="<?php echo $rowa1['id'] ?>"> <?php echo $rowa1['address']."    " ?><?php echo $rowa1['mobile'] ?></label></li>
 
<?php
      }
}
mysql_free_result($another_query5);
}
      ?>


      </ul>
    </div>
    <div class="order_time clearfix">
      <div class="order_time_title left">送餐时间： </div>
      <div class="order_time_list left">
        <select id="songcantime">
          <option value="立即送出">立即送出</option>
          <option value="明日中午">明日中午</option>
          <option value="11:00:00">11:00:00</option>
          <option value="11:15:00">11:15:00</option>
          <option value="11:30:00">11:30:00</option>
          <option value="11:45:00">11:45:00</option>
          <option value="12:00:00">12:00:00</option>
          <option value="12:15:00">12:15:00</option>
          <option value="12:30:00">12:30:00</option>
          <option value="12:45:00">12:45:00</option>
          <option value="13:00:00">13:00:00</option>
          <option value="13:15:00">13:15:00</option>
          <option value="13:30:00">13:30:00</option>
          <option value="13:45:00">13:45:00</option>
          <option value="14:00:00">14:00:00</option>
          <option value="14:15:00">14:15:00</option>
          <option value="14:30:00">14:30:00</option>
          <option value="14:45:00">14:45:00</option>
          <option value="15:00:00">15:00:00</option>
          <option value="15:15:00">15:15:00</option>
          <option value="15:30:00">15:30:00</option>
          <option value="15:45:00">15:45:00</option>
          <option value="16:00:00">16:00:00</option>
          <option value="16:15:00">16:15:00</option>
          <option value="16:30:00">16:30:00</option>
          <option value="16:45:00">16:45:00</option>
          <option value="17:00:00">17:00:00</option>
           <option value="17:15:00">17:15:00</option>
            <option value="17:30:00">17:30:00</option>
             <option value="17:45:00">17:45:00</option>
              <option value="18:00:00">18:00:00</option>
          <option value="18:15:00">18:15:00</option>
          <option value="18:30:00">18:30:00</option>
          <option value="18:45:00">18:45:00</option>
          <option value="19:00:00">19:00:00</option>


        </select>
      </div>
    </div>
    <div class="order_payment clearfix">
      <div class="order_payment_title left">支付方式： </div>
      <div class="order_payment_list left">
        <img src="images/payment.jpg">
      </div>
    </div>
  </div>
  <div style="margin:40px 0px 20px 20px;">
    <input type="image" id="insertOrder" src="images/order.jpg">
  </div>
</div>



<div class="content clearfix">
  <div class="shop_top clearfix">
    <div class="shop_top_left left">
      <div class="shopinfo">
        <div class="clearfix">
          <div class="sub_logo left"><a href="#"><img src="<?php echo  $row[25] ?>" width="42" height="42"></a></div>
          <div class="left"><span class="store"><a href="#">

          <?php

            $nextstring=$row[1];
              $tmpstr = "";
              if(strlen($nextstring)>12){ 
        $hi=utf8Substr($nextstring,0,4);
      $nextstring=$hi."...";
    }
           echo  $nextstring;



            ?>


          </a></span><span class="store_case">中式快餐</span></div>
          </div>
          <div class="sub_info"><div class="sub_time left"></div><div class="left">
          <?php
            if($row[85]==1){
          
          ?>
<img src="images/sub1.gif">

          <?php
}

          ?>
          <?php
            if($row[86]==1){
          
          ?>
<img src="images/sub2.gif">

          <?php
}

          ?>
           <?php
            if($row[87]==1){
          
          ?>
<img src="images/sub3.gif">

          <?php
}

          ?>
             </div></div>
      </div>
      <div class="shopinfo_3 left">
        <div><a href="###" id="qisong" >起 送 价</a>：<?php echo  round($row[75],1) ?>元</div>
        <div>地    址：<?php echo  $row[3] ?></div>
        <div>营业时间：<?php echo  $row[9] ?></div>
        <div>电    话：<span id="orderphone"><?php echo  $row[80] ?></span></div>
      </div>
      <div class="shopnotice left"><span class="notice_title">公告:</span> <?php echo  html_entity_decode($row[5]) ?></div>
    </div> 
    <div class="shop_top_right right"><span class="notice_title">活动：</span><?php echo  html_entity_decode($row[82]) ?></div>
  </div>
  <div class="content_con clearfix" style="margin-top:10px;">
    <div class="order_left left">
      <div class="box">
        <div class="box_title">
          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="order_title">
            <tr>
              <td width="400" class="td_frist">名称</td>
              <td width="80" align="center">价钱</td>
              <td width="90" align="center">数量</td>
              <td align="center">人气</td>
            </tr>
          </table>
        </div>




<?php
   $suoyin=0;
          $another_query = mysql_query("select t.*,b.name as bname,b.id as bid from do_supplier_location_menu t,do_supplier_location_menu_cate b where t.supplier_location_id=".$row[0]." and b.id=t.cate_id and b.supplier_location_id=t.supplier_location_id GROUP BY bname ORDER BY bid");

          while($rowa = mysql_fetch_array($another_query)){
          ?>  
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="orderlist" style="border-top:1px solid #c0d4d4;">
          <tr class="title_tr">
            <th colspan="4" class="td_frist"><?php echo $rowa["bname"] ?></th>
          </tr>
          <?php
                $area_query = mysql_query("select * from do_supplier_location_menu where supplier_location_id=".$rowa[1]." and cate_id=".$rowa[5]." order by id");
            
          while($row = mysql_fetch_array($area_query)){

            $suoyin+=1;
          ?>  
          <tr>
            <td width="400" class="td_frist" id="orderName<?php echo $row['id'] ?>"><?php echo $row['name'] ?></td>
            <td width="80" align="center" ><span id="orderPrice<?php echo $row['id'] ?>"><?php echo  round($row['price'],1) ?></span>元</td>
            <td width="90" align="center"><span class="number"><a href="###"><img onclick="orderNumRemove(<?php echo $row['id'] ?>)" class="showdongxi" src="images/subtract.png"></a></span> <span id="orderNum<?php echo $row['id'] ?>">0</span> <span class="number"><a href="###"><img class="showdongxi" onclick="orderNumAdd(<?php echo $row['id'] ?>)" src="images/add.png"></a></span></td>
            <td align="center">本月<?php 
            if($row['collect_nums']>0){
            echo $row['collect_nums']; 
}else{
  echo "0";
}
            ?>人订</td>
          </tr>
          <?php 
            }
             mysql_free_result($area_query);
          ?> 
          
        </table>
        <?php 
            }

           mysql_free_result($another_query);

          ?> 
        
      </div>
    </div>
    <div class="order_right right">
      <div class="box" style="margin-bottom:0px;">
        <div class="box_title"><div class="box_title_title1">购物车</div></div>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="shopping">
        <tbody id="moreOrder">
            
           </tbody>
          <tr>
            <td height="40" colspan="4" align="right" class="td_last"><span class="total">总价：<span id="lastprice">0</span>元 &nbsp;&nbsp;

<?php
  date_default_timezone_set("Asia/Shanghai");
$codt=time();
$nowshifen=date("1992-12-28 H:i:s",$codt);
if($stopbusiness!=1){
if("1992-12-28 ".$hello[0].":00"<$nowshifen&&"1992-12-28 ".$hello[1].":00">$nowshifen){

?>
            <a href="javascript:void(0)" id="order">下单</a>
<?php
}else{


  echo ' <a href="javascript:void(0)" onclick="showxiadan()" id="closeorder">下单</a>';
}
}else{
echo ' <a href="javascript:void(0)" onclick="showxiadan()" id="closeorder">下单</a>';

}


?>


            </span></td>
          </tr>
        </table>
      </div>
      <div class="box" style="margin-top:10px;">
        <div class="box_title"><div class="box_title_title1">友情提示</div></div>
        <div class="box_content clearfix" style="padding:10px 15px;">
          <span class="tips">

            <?php echo html_entity_decode($online_info) ?>

          </span>
        </div>
      </div>
      
      <!-- 评论start -->
      <div class="box" style="margin-top:10px;">
        <div class="box_title">
          <div class="box_title_title1">评论</div></div>
        <div class="box_content clearfix" style="padding:10px 15px;">
           <ul class="message messageadd" id="showMessage">
            
            <!--  <li class="clearfix">
              <div class="left clearfix"><span id="c_content" ></span></div> <div class="clearfix"><span class="right" id="c_createtime" ></span><span class="right" id="c_username"></span></div>
             <div class="hf clearfix">管理员回复：<br>已经送过去了！</div>
            </li>-->
           </ul>
          <div class="leavemess">
            <div>
            <?php
if(isset($_SESSION['username'])){
            ?>
            <a onclick="doMyComment(0)" id="ihuifu">我要留言</a>
<?php
}else{

  echo ' <a onclick="anotherHuifu()" id="ihuifu">我要留言</a>';
}


?>
            </div>
            <div id="ccshow"  style="display:none"><textarea name="content" id="content" >
              <?php
                  if(isset($_SESSION['username'])){
                  $local_arraya = mysql_query("select * from do_deal_order  where user_id=".$_SESSION['userid']." order  by id desc limit 1");
                  while($rowa = mysql_fetch_array($local_arraya)){
                    $userMessage="";
                    $userMessage.="您好 我的订单号 ".$rowa['order_sn']." 要饿死了，快点好吗！ 订单内容 ".round($rowa['total_price'],1)."元套餐之\r\n";
  
                    $arrayzhengti = split(" ",$rowa['food']);
                    $count_array = count($arrayzhengti);
                    $shuliang=0;
                    $x=0;
                    for($x==0;$x<$count_array;$x++){
                    $arrayFensan=split(",",$arrayzhengti[$x]);  

                    $shuliang+=$arrayFensan[1];
                    $local_array2 = mysql_query("select * from do_supplier_location_menu   where id=".$arrayFensan[0]);
                    $row3 = mysql_fetch_row($local_array2);
                    
                    mysql_free_result($local_array2); 
                    $userMessage.=$row3[2]."   ".$arrayFensan[1]."份  \r\n";
                    if($x==$count_array){
                    }else{}
                    }
                  }
                  echo $userMessage;
                  mysql_free_result($local_arraya);
                  }
              ?></textarea></div>
            <?php
              print_r($rowa);
            ?>
            <div id="ccshow" style="display:none"><a onclick="addComment();"><input type="image" src="images/submit.jpg"></a></div>
          </div>
        </div>
      </div>
      <!-- 评论end -->
      
    </div>
  </div>
</div>

<?php include('bottom.php') ?> 
</body>
</html>
